﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using DAL;
using System.Collections.Generic;
using Model;

namespace UnitTest
{
    [TestClass]
    public class UnitTest1
    {
        Resource_DAL resource_DAL = new Resource_DAL();

        [TestMethod]
        public void SearchResourceList()
        {
            IEnumerable<Resource> list = resource_DAL.SearchResourceList();
            Assert.IsNotNull(list);
        }

        [TestMethod]
        public void Add()
        {
            Resource resource = new Resource();
            resource.Size = 1;
            resource.Property = "sa";
            resource.Path = "das";
            resource.Name = "das";
            resource.MIME = "das";
            resource.LastUpdateTime = DateTime.Now;
            resource.CreateTime = DateTime.Now;
            bool b = resource_DAL.Add(resource);
            Assert.IsNotNull(b);
        }

        [TestMethod]
        public void GetById()
        {
            Resource b = resource_DAL.GetById(2);
            Assert.IsNotNull(b);
        }
    }
}
